home *** CD-ROM | disk | FTP | other *** search
/ Champak 146 / (Vol 146) Jan 07 2012.iso / Games / scuba.swf / scripts / frame_1 / DoAction_2.as next >
Text File  |  2012-01-07  |  3KB  |  101 lines

  1. function fnSetConstants()
  2. {
  3.    TOTAL_BG_LENGTH = Number(coral._width);
  4.    INTERFACE_WIDTH = Number(560);
  5.    SPEED = Number(4);
  6.    FISH_SPEED = Number(7);
  7.    FISH_ACCEL = Number(FISH_SPEED - SPEED);
  8.    INTERFACE_CENTER_X = Number(280 + Number(177));
  9.    FULL_OXYGEN = Number(26);
  10.    BG_START_POSITION = Number(coral._x);
  11.    BG_LEFT_LIMIT = Number(INTERFACE_CENTER_X - Number(Number(TOTAL_BG_LENGTH / 2) - Number(INTERFACE_WIDTH / 2)));
  12.    BG_RIGHT_LIMIT = Number(INTERFACE_CENTER_X + Number(Number(TOTAL_BG_LENGTH / 2) - Number(INTERFACE_WIDTH / 2)));
  13.    WALL_PENALTY = Number(3);
  14.    CREATURE_PENALTY = Number(3);
  15.    VERT_FACTOR = Number(16);
  16.    LEFT_BOUND = Number(177);
  17.    RIGHT_BOUND = LEFT_BOUND + Number(INTERFACE_WIDTH);
  18.    TOP_BOUND = Number(67);
  19.    BOTTOM_BOUND = Number(327);
  20.    TANK_REFILL = Number(10);
  21.    POINTS_FOR_MINE_cadet = Number(10);
  22.    POINTS_FOR_MINE_commando = Number(15);
  23.    SAFETY_DIFF = Number(28);
  24.    LOW_OXYGEN = Number(10);
  25. }
  26. function fnGetRoot(mySWF)
  27. {
  28.    var vfullpath = _url;
  29.    var vtrimloc = vfullpath.indexOf(mySWF);
  30.    SITEROOT = vfullpath.substring(0,vtrimloc);
  31. }
  32. function fnPauseGame()
  33. {
  34.    gPaused = true;
  35.    if(gRecruitStatus == "hit" || gRecruitStatus == "recovering" && _currentframe != 18)
  36.    {
  37.       recruitResetFrame = Number(recruit._currentframe);
  38.    }
  39.    timer.gotoAndStop("base");
  40.    scrollerClip.gotoAndStop("base");
  41.    oxygenLauncher.gotoAndStop("base");
  42.    fishLauncher.gotoAndStop("base");
  43.    mineLauncher.gotoAndStop("base");
  44.    gProdFrame = recruit.vProdFrame;
  45.    if(gProdFrame == undefined && gProdStatus != "activated")
  46.    {
  47.       gProdFrame = Number(1);
  48.    }
  49.    gJumpLoc = true;
  50.    recruitResetX = recruit._x;
  51.    recruitResetY = recruit._y;
  52.    coralResetX = coral._x;
  53.    i = 0;
  54.    while(i < activeTanks.length)
  55.    {
  56.       set(activeTanks[i] + "ResetX",eval(activeTanks[i] + "._x"));
  57.       set(activeTanks[i] + "ResetY",eval(activeTanks[i] + "._y"));
  58.       setProperty(activeTanks[i], _visible, 0);
  59.       i++;
  60.    }
  61.    i = 0;
  62.    while(i < activeMines.length)
  63.    {
  64.       set(activeMines[i] + "ResetX",eval(activeMines[i] + "._x"));
  65.       set(activeMines[i] + "ResetY",eval(activeMines[i] + "._y"));
  66.       setProperty(activeMines[i], _visible, 0);
  67.       i++;
  68.    }
  69.    i = 0;
  70.    while(i < activeFishies.length)
  71.    {
  72.       set(activeFishies[i] + "ResetX",eval(activeFishies[i] + "._x"));
  73.       set(activeFishies[i] + "ResetY",eval(activeFishies[i] + "._y"));
  74.       setProperty(activeFishies[i], _visible, 0);
  75.       i++;
  76.    }
  77. }
  78. function fnViewBriefing()
  79. {
  80.    if(gInGame == true)
  81.    {
  82.       if(gPaused == false)
  83.       {
  84.          fnPauseGame();
  85.       }
  86.    }
  87.    else if(endClip._currentframe == 1 || endClip._currentframe == undefined)
  88.    {
  89.       gResumeFrame = null;
  90.    }
  91.    else if(gScore >= 200)
  92.    {
  93.       gResumeFrame = "passend";
  94.    }
  95.    else
  96.    {
  97.       gResumeFrame = "nopassend";
  98.    }
  99.    gotoAndStop(28);
  100. }
  101.